Trò chơi Tic-Tac-Toe, game đánh caro full source code
53.439 lượt xem;
- PhotonRigidbody2DViewEditor.cs
- Views /
- PhotonNetwork /
- Editor /
- Photon Unity Networking /
- Assets /
- project /
1 using UnityEditor;
2 using UnityEngine;
3
4 [CustomEditor(typeof (PhotonRigidbody2DView))]
5 public class PhotonRigidbody2DViewEditor : Editor
6 {
7 public override void OnInspectorGUI()
8 {
9 PhotonGUI.ContainerHeader("Options");
10
11 Rect containerRect = PhotonGUI.ContainerBody(EditorGUIUtility.singleLineHeight*2 + 10);
12
13 Rect propertyRect = new Rect(containerRect.xMin + 5, containerRect.yMin + 5, containerRect.width, EditorGUIUtility.singleLineHeight);
14 EditorGUI.PropertyField(propertyRect, serializedObject.FindProperty("m_SynchronizeVelocity"), new GUIContent("Synchronize Velocity"));
15
16 propertyRect.y += EditorGUIUtility.singleLineHeight;
17 EditorGUI.PropertyField(propertyRect, serializedObject.FindProperty("m_SynchronizeAngularVelocity"), new GUIContent("Synchronize Angular Velocity"));
18 }
19 }
2 using UnityEngine;
3
4 [CustomEditor(typeof (PhotonRigidbody2DView))]
5 public class PhotonRigidbody2DViewEditor : Editor
6 {
7 public override void OnInspectorGUI()
8 {
9 PhotonGUI.ContainerHeader("Options");
10
11 Rect containerRect = PhotonGUI.ContainerBody(EditorGUIUtility.singleLineHeight*2 + 10);
12
13 Rect propertyRect = new Rect(containerRect.xMin + 5, containerRect.yMin + 5, containerRect.width, EditorGUIUtility.singleLineHeight);
14 EditorGUI.PropertyField(propertyRect, serializedObject.FindProperty("m_SynchronizeVelocity"), new GUIContent("Synchronize Velocity"));
15
16 propertyRect.y += EditorGUIUtility.singleLineHeight;
17 EditorGUI.PropertyField(propertyRect, serializedObject.FindProperty("m_SynchronizeAngularVelocity"), new GUIContent("Synchronize Angular Velocity"));
18 }
19 }